package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.EmrVo;
import com.mk.admin.service.EmrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/emr")
@Api(tags = "电子病历")
public class EmrController extends BaseController<EmrVo> {

    @Autowired
    private EmrService emrService;


    @PostMapping("/select")
    @Override
    @ApiOperation(value = "根据医生id获取电子病历", tags = "电子病历", notes = "根据医生id获取电子病历")
    public ResultDto select(@RequestBody EmrVo emrVo) {
        return emrService.getEmrInfoByDocID(emrVo);
    }

    @PostMapping("/add")
    @Override
    @ApiOperation(value = "新增电子病历", tags = "电子病历", notes = "新增电子病历")
    public ResultDto add(@RequestBody EmrVo emrVo) {
        return emrService.add(emrVo);
    }


}
